package com.controller;


import com.service.BaiduMapServiceImpl;
import com.vo.NearFriend;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@CrossOrigin("*")
public class BaiduMapController {

    @Autowired
    private BaiduMapServiceImpl baiduMapService;

    @RequestMapping("/nearFriend")
    public List<NearFriend> nearFriends(double x,double y){
        String me="me"; //要从登录的用户名中获取
        System.out.println(x+","+y+"============");
        baiduMapService.addData(me,x,y);
        return baiduMapService.nearFriends(me,50*1000,10);

    }

}
